<?php
require_once ("../db/connectdatabase.php");
require_once ("../entitys/QuestionCard.php");


function insertQuestion($question) {
	$con = new ConnectDB();
	$tbl = "questioncard";
	$fn = array('quesinfocard' => ($question -> getQuestion()), 'answercard' => ($question -> getAnswer()), 'datecreate' => ($question -> getDatecreate()));
	return $con -> insert($tbl, $fn);
}

function updateQuestion($question) {
	$con = new ConnectDB();
	$tbl = "questioncard";
	$fn = array('quesinfocard' => ($question -> getQuestion()), 'answercard' => ($question -> getAnswer()), 'datecreate' => ($question -> getDatecreate()));
	$condition = array('idques' => ($question -> getID()));
	return $con -> update($tbl, $fn, $condition);
}

function deleteQuestion($idquestion) {
	$con = new ConnectDB();
	$tbl = "questioncard";
	$condition = array('idques' => $idquestion);
	return $con -> delete($tbl, $condition);
}

?>